package service.impl;

import dao.BookDao;
import dao.Impl.BookDaoImpl;
import pojo.Book;
import service.BookService;
import java.util.List;

public class BookServiceImpl implements BookService {
    private BookDao bookDao = new BookDaoImpl();

    @Override
    public boolean addBook(Book book) {
        return bookDao.addBook(book);
    }

    @Override
    public boolean deleteBook(int id) {
        return bookDao.deleteBook(id);
    }

    @Override
    public boolean updateBook(Book book) {
        return bookDao.updateBook(book);
    }

    @Override
    public List<Book> getAllBooks() {
        return bookDao.getAllBooks();
    }

    @Override
    public Book getBookById(int id) {
        return bookDao.getBookById(id);
    }

    @Override
    public List<Book> getBooksByCondition(String name, String author, int offset, int pageSize) {
        return bookDao.getBooksByCondition(name, author, offset, pageSize);
    }

    @Override
    public int countBooksByCondition(String name, String author) {
        return bookDao.countBooksByCondition(name, author);
    }
}